﻿<Window x:Class="MyGamesModule.Views.OpenWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cal="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
        xmlns:region="clr-namespace:MessageModule.RegionTypes;assembly=MessageModule"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        Title="GameWindow" AllowsTransparency="True" WindowStyle="None" Background="{x:Null}" 
        x:Name="game" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" SizeToContent="WidthAndHeight">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Closing">
            <i:InvokeCommandAction Command="{Binding ClosingCommand}"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>
    
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries> 
                <!--按钮样式定义-->
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Styles/ButtonStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Styles/MessageBoxStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Border BorderBrush="{StaticResource border}" BorderThickness="1" CornerRadius="3" Background="{StaticResource bg}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="28"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="5"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" Background="{StaticResource tilebtn_bg}">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseLeftButtonDown">
                        <i:InvokeCommandAction Command="{Binding DragCommand}" CommandParameter="{Binding ElementName=game}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="35"/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="40"/>
                    <ColumnDefinition Width="40"/>
                </Grid.ColumnDefinitions>
                <Path Grid.Column="1" Fill="{StaticResource arrow}"  Stretch="Fill" Height="18" Width="30" Data="F1 M 38,28.5C 41.1667,28.5 50.2708,20.5833 55.0208,30.0833C 59.7708,39.5833 58.5833,52.25 55.4167,52.25C 47.5,52.25 52.25,44.3333 38,44.3333C 23.75,44.3333 28.5,52.25 20.5833,52.25C 17.4167,52.25 16.2292,39.5833 20.9792,30.0833C 25.7292,20.5834 34.8333,28.5 38,28.5 Z M 26.9167,32.0625L 26.9167,34.8334L 24.1458,34.8334L 24.1458,38L 26.9167,38L 26.9167,40.7709L 30.0833,40.7709L 30.0833,38L 32.8542,38L 32.8542,34.8334L 30.0833,34.8334L 30.0833,32.0625L 26.9167,32.0625 Z M 45.125,34.0417C 44.2505,34.0417 43.5416,34.7506 43.5416,35.625C 43.5416,36.4995 44.2505,37.2084 45.125,37.2084C 45.9994,37.2084 46.7083,36.4995 46.7083,35.625C 46.7083,34.7506 45.9994,34.0417 45.125,34.0417 Z M 48.2917,31.2708C 47.4172,31.2708 46.7083,31.9797 46.7083,32.8542C 46.7083,33.7286 47.4172,34.4375 48.2917,34.4375C 49.1661,34.4375 49.875,33.7286 49.875,32.8542C 49.875,31.9797 49.1661,31.2708 48.2917,31.2708 Z M 48.2917,37.2083C 47.4172,37.2083 46.7083,37.9172 46.7083,38.7917C 46.7083,39.6661 47.4172,40.375 48.2917,40.375C 49.1661,40.375 49.875,39.6661 49.875,38.7917C 49.875,37.9172 49.1661,37.2083 48.2917,37.2083 Z M 51.4583,34.0417C 50.5839,34.0417 49.875,34.7505 49.875,35.625C 49.875,36.4995 50.5839,37.2083 51.4583,37.2083C 52.3328,37.2083 53.0417,36.4995 53.0417,35.625C 53.0417,34.7505 52.3328,34.0417 51.4583,34.0417 Z "/>
                <TextBlock Grid.Column="3" VerticalAlignment="Center" Foreground="{StaticResource bg_text}" FontSize="17"><Run Text="{Binding Title}"/></TextBlock>
                <Button Width="40" Grid.Column="4" Height="22" Style="{StaticResource SysMinBtn}" VerticalAlignment="Top" 
                        Command="{Binding MinedCommand}"
                        CommandParameter="{Binding ElementName=game}"/>
                <Button Width="40" Grid.Column="5" Height="22" Style="{StaticResource SysCloseBtn}" VerticalAlignment="Top" 
                        Command="{Binding CloseCommand}"
                        CommandParameter="{Binding ElementName=game}"/>
            </Grid>
            <ContentControl Grid.Row="1"  cal:RegionManager.RegionName="{x:Static region:RegionTypes.ModuleRegion}"/> 
        </Grid>
    </Border>
</Window>
